package com.ruoyi.produce.process.costApportionment.mapper;

import com.ruoyi.produce.process.costApportionment.domain.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 在产成本费用分摊
 * 数据层
 */
public interface CostApportionmentMapper {
    /**
     * 在产成本费用分摊查询
     * @param cond
     * @return
     */
    List<CostApportionmentDto> selectCostApportionmentList(CostApportionmentCond cond);

    /**
     * 按编号查询
     * @param costApportionmentId 在产成本费用分摊编号
     * @return
     */
    CostApportionmentDto selectCostApportionmentById(String costApportionmentId);

    /**
     * 获取最新的一条在产成本费用分摊编号
     * @return
     */
    String getCostApportionmentId();

    /**
     * 在产成本费用分摊新增
     * @param costApportionment
     * @return
     */
    int insertCostApportionment(CostApportionmentDomain costApportionment);

    /**
     * 在产成本费用分摊更新
     * @param costApportionment
     * @return
     */
    int updateCostApportionment(CostApportionmentDomain costApportionment);

    /**
     * 更新在产成本费用分摊删除标志位
     * @param costApportionment
     * @return
     */
    int updateCostApportionmentDeleteFlag(CostApportionmentDomain costApportionment);

    /**
     * 在产成本费用分摊详细查询
     * @param cond
     * @return
     */
    List<CostApportionmentListDto> selectCostApportionmentListList(CostApportionmentCond cond);

    /**
     * 查询在产成本费用分摊对应的所有产品详细
     * @param costApportionmentId 在产成本费用分摊编号
     * @return
     */
    List<CostApportionmentListDto> selectCostApportionmentListListById(String costApportionmentId);

    /**
     * 通过生产计划查询费用分摊记录
     * @param planSelfId
     * @return
     */
    CostApportionmentListDto selectCostApportionmentListListByPlanSelfId(String planSelfId);

    /**
     * 查询在产成本费用分摊对应的指定产品详细
     * @param costApportionmentId 在产成本费用分摊编号
     * @param planSelfId 自产生产计划编号
     * @return
     */
    CostApportionmentListDto  selectCostApportionmentListById(@Param("costApportionmentId")String costApportionmentId, @Param("planSelfId")String planSelfId);

    /**
     * 在产成本费用分摊详细新增
     * @param costApportionmentList
     * @return
     */
    int insertCostApportionmentList(CostApportionmentListDomain costApportionmentList);

    /**
     * 在产成本费用分摊详细更新
     * @param costApportionmentList
     * @return
     */
    int updateCostApportionmentList(CostApportionmentListDomain costApportionmentList);

    /**
     * 删除在产成本费用分摊详细
     * @param costApportionmentId  在产成本费用分摊编号
     * @param planSelfId 自产生产计划编号
     * @return
     */
    int deleteCostApportionmentListById(@Param("costApportionmentId")String costApportionmentId, @Param("planSelfId")String planSelfId);
}
